#include<stdio.h>

long long combine(int up,int down);
long long stair(int up);
int main(void)
{
	int N,times,half;
	long long sum;
	
	while(scanf("%d",&N)!=EOF&&N)
	{
		if(N%2==0)
		{
			half=N/2;
			sum=0;
			for(int i=N;i>=half;i--)
			{
				sum+=combine(N-i,i);
			}
			printf("%d\n",sum);
		}
		else
		{
			half=(N+1)/2;
			sum=0;
			for(int i=N;i>=half;i--)
			{
				sum+=combine(N-i,i);
			}
			printf("%d\n",sum);
		}
	}

	return 0;
}

long long combine(int up,int down)
{
	long long ans=1;
	if(up>down/2)
	{
		up=down-up;
	}
	for(int i=0;i<up;i++)
	{
		ans*=down;
		down--;
	}
	ans/=stair(up);
	
	return ans;
}

long long stair(int up)
{
	long long output;
	if(up==0||up==1)
	{
		output=1;
	}
	else
	{
		output=up*stair(up-1);
	}
	return output;
}
